package q2d.program;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import q2d.netWrap.*;

/* To jest tylko aplikacja testowa!*/
public class testApp {
	public static void main( String[] argv ){
		Ncontroller nc = new Ncontroller(9999);
		nc.listen();
		Npacket dw = null;
		
		/*
		while(true){
			while((dw = nc.pop())==null){}
			Nwrapper wrapper = (Nwrapper)nc.retrieveObject(dw);
			if(wrapper.getType() == 1){
				TestClassA testA = (TestClassA)wrapper.getObject();
				System.out.print("A: ");
				System.out.print(testA.getId());
				System.out.print(testA.getX());
				System.out.print(testA.getY());
				System.out.println();
			} 
			else { 
				TestClassB testB = (TestClassB)wrapper.getObject();
				System.out.print("B:");
				System.out.print(testB.getId());
				System.out.print(testB.getX());
				System.out.print(testB.getY());
				System.out.println();
			}
		}
		*/
		//nc.close();
	
	
		try {
	    	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    	String name = null;
	    	while (name == null) {
	    		System.out.print("imie> ");
	    		name = in.readLine();
	    	}
	    } catch (IOException e) {}
		System.out.println("objects:");
		nc.printQueue();
		nc.close();
	}
}
